<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            margin: auto;
            width: 200px;
            height: 200px;
            transform-style: preserve-3d;
            transform: rotateX(20deg) rotateY(-20deg);
            animation: circling 30s infinite linear alternate;
        }
        .box_1 {
            position: absolute;
            width: 200px;
            height: 200px;
            font-size:60px;
            line-height: 200px;
            text-align: center;
            border: 2px solid rebeccapurple;
        }

        .box2 {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            margin: auto;
            width: 100px;
            height: 100px;
            transform-style: preserve-3d;animation: circling 5s infinite linear alternate;
        }
        .box_2 {
            position: absolute;
            width: 100px;
            height: 100px;
            font-size:30px;
            line-height: 100px;
            text-align: center;
        }

        .box .box_1:nth-child(1) {
            background: rgba(255,255,0,0.4);
            transform: rotateX(90deg) translateZ(100px);
            animation: a1 .5s infinite  alternate;
        }
        .box .box_1:nth-child(2) {
            background: rgba(128,255,128,0.4);
            transform: rotateX(-90deg) translateZ(100px);
            animation: a2 .5s infinite  alternate;
        }
        .box .box_1:nth-child(3) {
            background: rgba(255,128,0,0.4);
            transform: rotateY(90deg) translateZ(100px);
            animation: a3 .5s infinite  alternate;
        }
        .box .box_1:nth-child(4) {
            background: rgba(128,255,0,0.4);
            transform: rotateY(-90deg) translateZ(100px);
            animation: a4 .5s infinite  alternate;
        }
        .box .box_1:nth-child(5) {
            background: rgba(0,255,255,0.4);
            transform: translateZ(100px);
            animation: a5 .5s infinite  alternate;
        }
        .box .box_1:nth-child(6) {
            background: rgba(255,0,255,0.4);
            transform: rotateY(180deg) translateZ(100px);
            animation: a6 .5s infinite  alternate;
        }

        .box2 .box_2:nth-child(1) {
            background: rgba(255,255,0,0.6);
            transform: rotateX(90deg) translateZ(50px);
        }
        .box2 .box_2:nth-child(2) {
            background: rgba(128,255,128,0.6);
            transform: rotateX(-90deg) translateZ(50px);
        }
        .box2 .box_2:nth-child(3) {
            background: rgba(255,128,0,0.6);
            transform: rotateY(90deg) translateZ(50px);
        }
        .box2 .box_2:nth-child(4) {
            background: rgba(128,255,0,0.6);
            transform: rotateY(-90deg) translateZ(50px);
        }
        .box2 .box_2:nth-child(5) {
            background: rgba(0,255,255,0.6);
            transform: translateZ(50px);

        }
        .box2 .box_2:nth-child(6) {
            background: rgba(255,0,255,0.6);
            transform: rotateY(180deg) translateZ(50px);
        }
        
        @keyframes circling {
            from {
                transform: rotateX(20deg) rotateY(-20deg);
            }
            to {
                transform: rotateX(120deg) rotateY(-360deg);
            }
        }

        @keyframes a1 {
            from {
                transform: rotateX(90deg) translateZ(100px);
            }
            to {
                transform: rotateX(90deg) translateZ(400px);
            }
        }

        @keyframes a2 {
            from {
                transform: rotateX(-90deg) translateZ(100px);
            }
            to {
                transform: rotateX(-90deg) translateZ(400px);
            }
        }

        @keyframes a3 {
            from {
                transform: rotateY(90deg) translateZ(100px);
            }
            to {
                transform: rotateY(90deg) translateZ(400px);
            }
        }


        @keyframes a4 {
            from {
                transform: rotateY(-90deg) translateZ(100px);
            }
            to {
                transform: rotateY(-90deg) translateZ(400px);
            }
        }


        @keyframes a5 {
            from {
                transform: translateZ(100px);
            }
            to {
                transform: translateZ(400px);
            }
        }


        @keyframes a6 {
            from {
                transform: rotateY(180deg) translateZ(100px);
            }
            to {
                transform: rotateY(180deg) translateZ(400px);
            }
        }
    </style>
</head>
<body>
<div class="box">
    <div class="box_1">1</div>
    <div class="box_1">2</div>
    <div class="box_1">3</div>
    <div class="box_1">4</div>
    <div class="box_1">5</div>
    <div class="box_1">6</div>
    <div class="box2">
        <div class="box_2">1</div>
        <div class="box_2">2</div>
        <div class="box_2">3</div>
        <div class="box_2">4</div>
        <div class="box_2">5</div>
        <div class="box_2">6</div>
    </div>
</div>

</body>
</html>